<?php
/******************************
@Filename	:shownews.php
@Version	:0.0.1
@Author		:xuhongquan
@Update		:2010-4-15
@Content	:php by Editplus
*******************************/
header("Content-type: text/html; charset=utf-8"); 
define('NOROBOT', TRUE);
require_once './include/common.inc.php';
include_once './include/dtxx.inc.php';
require_once("include/page.php");
$page=isset($_GET['page'])?intval($_GET['page']):0;
$buid=isset($_GET['id'])?intval($_GET['id']):0;
$type=isset($_GET['type'])?trim($_GET['type']):'';
$perpage=20;
$order=" order by tdate desc ";
if(in_array($type,$typelist)){
	$where=" where $type='1' and `isdel`='0' ";
}elseif(empty($type) && $buid){
	$where=" where buid='$buid' and `isdel`='0' ";
}else{
	include template('error');
}

$sql_all="select count(*) as num from  bl_dzgg $where ";
$n=$db->fetch_first($sql_all);
//print_r($n);die();
$list=new page($n['num'],$page,$perpage);  
$strartrow=$list->getStartRow();
$sql="select id,title,author,tdate,jian,ishit from bl_dzgg $where $order limit $strartrow,$perpage";   //从上面的起点开始查询出20条数据   
$news=newlist($sql);
if(empty($news)){
	include template('error');
}else{
	if($type=='jian'){
		$new['buname']='动态信息';
	}else if($type=='ishit'){
		$new['buname']='重要文电';
	}
	include template('news');
}




?>